package com.cy.pj.common.bo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * @author LiuXu
 * @create 2020-07-11 11:47
 */
@Getter
@Setter


public class PageObject<T> implements Serializable {

    private static final long serialVersionUID = -4872969072537127996L;
    //当前页码值
    private Integer pageCurrent = 1;
    //页面大小
    private Integer pageSize = 3;
    //总行数（查询得到）
    private Integer rowCount = 0;
    //总页数（计算得到）
    private Integer pageCount = 0;
    //当前页记录
    private List<T> records;

    public PageObject() {

    }

    public PageObject(Integer pageCurrent, Integer pageSize, Integer rowCount, List<T> records) {
        super();
        this.pageCurrent = pageCurrent;
        this.pageSize = pageSize;
        this.rowCount = rowCount;
        this.pageCount = (rowCount - 1) / pageSize + 1;
        this.records = records;
    }


}
